package cn.hjh.service.Impl;

import cn.hjh.dao.UserDao;
import cn.hjh.entity.User;
import cn.hjh.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service("userService")
public class UserServiceImpl implements UserService {


    //@Resource
    public void setDao(UserDao dao) {
        this.dao = dao;
    }

    //@Autowired
    //@Qualifier("dao")
    @Resource(name = "dao")
    private UserDao dao;

    @Override
    public void add(User user) {
        dao.save(user);

    }
}
